#****************************************************************************#
#* DIET cmake local file                                                    *#
#****************************************************************************#
# BLAS (Basic Linear Algebric Subroutines) example

IF( NOT BLAS_FOUND )
  MESSAGE( STATUS "BLAS example NOT compiled: BLAS library unavailable." )
ELSE( NOT BLAS_FOUND )
  INCLUDE_DIRECTORIES( ${DIET_SOURCE_DIR}/include )

  ### A single server...
  ADD_EXECUTABLE( server server.c )
  TARGET_LINK_LIBRARIES( server ${DIET_SERVER_LIBRARIES} ${BLAS_LIBRARIES} )
  INSTALL_TARGETS( /bin/examples/BLAS server )
  
  ### ... and many clients
  SET( C_CLIENT_EXAMPLES
    client
    dgemm_client )
  
  FOREACH( loop_var ${C_CLIENT_EXAMPLES} )
    ADD_EXECUTABLE( ${loop_var} ${loop_var}.c )
    TARGET_LINK_LIBRARIES( ${loop_var}
                           ${DIET_CLIENT_LIBRARIES} ${BLAS_LIBRARIES} )
    INSTALL_TARGETS( /bin/examples/BLAS ${loop_var} )
  ENDFOREACH( loop_var )
ENDIF( NOT BLAS_FOUND )
